<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg"/>
      <div class="banner-info">
        <div class="banner-title">
          {{sightName}}
        </div>
        <div class="banner-number">
          <span class="iconfont arrow-icon">&#xe650;</span>{{gallaryImgs.length}}
        </div>

      </div>

    </div>
    <fade-animation>
      <common-gallary v-show="showGallary" @close="handleGallaryClose" :imgs="gallaryImgs"></common-gallary>
    </fade-animation>

  </div>
</template>

<script>
import CommonGallary from 'common/gallary/gallary.vue'
import FadeAnimation from 'common/fade/fadeAnimation'
export default {
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGallary: false
    }
  },
  methods: {
    handleBannerClick: function () {
      this.showGallary = true
    },
    handleGallaryClose: function () {
      this.showGallary = false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  computed: {}
}
</script>

<style lang="stylus" scoped>
.banner
  position: relative
  overflow: hidden
  height: 0
  padding-bottom :55%
  .banner-img
    width :100%
  .banner-info
    position: absolute
    left: 0
    right :0
    bottom :0
    height :0.6rem
    line-height 0.6rem
    display: flex
    background-image :linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
    color :#ffffff
    .banner-title
      flex :1
      padding-left :0.2rem
    .banner-number
      background-color :#000000
      border-radius :0.4rem
      margin-right :0.2rem
      padding :0 0.2rem

</style>
